#include "dwgarc.h"

DwgArc::DwgArc() : mRadius(50), mStartAngle(0), mSpanAngle(90)  // 默认参数
{
    mType = DArc;
}

void DwgArc::setArc(const QPoint &center, int radius, int startAngle, int spanAngle)
{
    mCenter = center;
    mRadius = radius;
    mStartAngle = startAngle;
    mSpanAngle = spanAngle;
}

void DwgArc::Draw(QPainter *p)
{
    // 计算圆弧的边界矩形
    QRect arcRect(mCenter.x() - mRadius, mCenter.y() - mRadius,
                  mRadius * 2, mRadius * 2);
    // 绘制圆弧
    p->drawArc(arcRect, mStartAngle * 16, mSpanAngle * 16);
}
